{extend name="public/container"}
{block name="content"}
<div id="myApp" v-cloak>
    <div class="padding-10">
        <el-table
            :data="rows"
            style="width: 100%"
            v-loading="loading"
            element-loading-text="加载中"
            element-loading-spinner="el-icon-loading"
            size="mini">
            <el-table-column
                prop="id"
                label="编号"
                align="left">
            </el-table-column>

            <el-table-column
                prop="admin_name"
                label="ID/名称"
                align="left">
            </el-table-column>

            <el-table-column
                prop="path"
                label="路由"
                align="left">
            </el-table-column>

            <el-table-column
                prop="method"
                label="方式"
                align="left">
            </el-table-column>

            <el-table-column
                prop="ip"
                label="操作IP"
                align="left">
            </el-table-column>

            <el-table-column
                prop="type"
                label="类型"
                align="left">
            </el-table-column>

            <el-table-column
                prop="add_time"
                label="操作时间"
                align="left">
            </el-table-column>

        </el-table>
    </div>
    <div class="pagination">
        <el-pagination
            hide-on-single-page
            small
            layout="prev, pager, next"
            :total="rowsCount"
            :page-size="where.limit"
            @current-change="doLoadRows">
        </el-pagination>
    </div>
</div>
{/block}
{block name="script"}
<script>
    var my = new Vue({
        el: "#myApp",
        data(){
            return {
                rowsCount: 0,
                rows: [],
                where: {
                    page:1,
                    limit:pageSize,

                },
                loading:false,
            }
        },
        methods: {
            doLoadRows (page) {
                this.loading = true
                this.where.page  = page || 1
                axios.get(Url({a:'get_list' , q:this.where}))
                    .then(res => {
                        this.rows = res.data.data
                        this.rowsCount =res.data.count
                        this.loading = false
                    })
            }
        },
        mounted(){
            this.doLoadRows()
        }
    })
</script>
{/block}